/*     */ package btsm.servlet;
/*     */ 
/*     */ import btsm.bean.sqlCableWork;
/*     */ import java.io.IOException;
/*     */ import java.io.PrintStream;
/*     */ import javax.servlet.RequestDispatcher;
/*     */ import javax.servlet.ServletException;
/*     */ import javax.servlet.http.HttpServlet;
/*     */ import javax.servlet.http.HttpServletRequest;
/*     */ import javax.servlet.http.HttpServletResponse;
/*     */ 
/*     */ public class ser_cableJPole extends HttpServlet
/*     */ {
/*     */   public void init()
/*     */     throws ServletException
/*     */   {
/*     */   }
/*     */ 
/*     */   public void doGet(HttpServletRequest request, HttpServletResponse response)
/*     */     throws ServletException, IOException
/*     */   {
/*  23 */     sqlCableWork PC = new sqlCableWork("jointpole", "");
/*     */ 
/*  25 */     String seraction = request.getParameter("seraction");
/*  26 */     String stroccode = request.getParameter("txtoccode");
/*  27 */     String strocname = request.getParameter("txtocname");
/*  28 */     String strsnid = request.getParameter("snid");
/*  29 */     String strToPage = request.getParameter("ToPage");
/*  30 */     if (strToPage == null) {
/*  31 */       strToPage = request.getParameter("tToPage");
/*     */     }
/*     */ 
/*  34 */     System.out.println("接头杆号serBF：strocname:" + strocname);
/*  35 */     strocname = new String(strocname.getBytes("ISO8859-1"), "utf-8");
/*  36 */     System.out.println("接头杆号serEF中：strocname:" + strocname);
/*     */ 
/*  38 */     request.setAttribute("txtoccode", stroccode);
/*  39 */     request.setAttribute("txtocname", strocname);
/*     */ 
/*  41 */     String filesnames = request.getParameter("filesnames");
/*     */ 
/*  43 */     String msg = "";
/*  44 */     String strRedURL = "common.jsp";
/*     */ 
/*  46 */     if (seraction.equalsIgnoreCase("serinsertsimple"))
/*     */     {
/*  48 */       boolean result = PC.insertsimple(stroccode, strocname);
/*     */ 
/*  50 */       if (result)
/*  51 */         msg = "新建接头杆号成功";
/*     */       else
/*  53 */         msg = "新建接头杆号失败";
/*     */     }
/*  55 */     else if (seraction.equals("seradd")) {
/*  56 */       String[] fieldsg = request.getParameterValues("T1");
/*     */ 
/*  58 */       boolean result = PC.add(fieldsg);
/*  59 */       if (result)
/*  60 */         msg = "新建光缆成功";
/*     */       else {
/*  62 */         msg = "新建光缆失败";
/*     */       }
/*     */     }
/*  65 */     else if (seraction.equals("sermodp"))
/*     */     {
/*  67 */       request.setAttribute("snid", strsnid);
/*     */ 
/*  69 */       if (strToPage == null) {
/*  70 */         strToPage = "1";
/*     */       }
/*  72 */       strRedURL = "nnmd_cableJPole.jsp?ToPage=" + strToPage;
/*  73 */     } else if (seraction.equals("serdel"))
/*     */     {
/*  75 */       if (PC.delbyid(strsnid))
/*  76 */         msg = "光缆信息删除成功";
/*     */       else {
/*  78 */         msg = "光缆信息删除失败";
/*     */       }
/*  80 */       strsnid = "";
/*  81 */     } else if (seraction.equals("sermod"))
/*     */     {
/*  83 */       String[] fieldxg = request.getParameterValues("T1");
/*     */ 
/*  85 */       if (PC.mdByID(fieldxg, strsnid))
/*  86 */         msg = "接头杆号信息修改成功";
/*     */       else {
/*  88 */         msg = "接头杆号信息修改失败";
/*     */       }
/*     */     }
/*     */ 
/*  92 */     PC.dbConClose();
/*  93 */     String filesnamesmd = "ser_cableJPole?seraction=sermodp&txtoccode=" + stroccode + "&txtocname=" + strocname + "&filesnames=" + filesnames + "&snid=" + strsnid + "&ToPage=" + strToPage;
/*  94 */     request.setAttribute("filesnames", filesnamesmd);
/*  95 */     request.setAttribute("msg", msg);
/*  96 */     RequestDispatcher btsm = request.getRequestDispatcher(strRedURL);
/*  97 */     btsm.forward(request, response);
/*     */   }
/*     */ 
/*     */   public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
/*     */   {
/* 102 */     doGet(request, response);
/*     */   }
/*     */ 
/*     */   public void destroy()
/*     */   {
/*     */   }
/*     */ }

/* Location:           E:\java\apache-tomcat-6.0.36\webapps\btsm\WEB-INF\classes\
 * Qualified Name:     btsm.servlet.ser_cableJPole
 * JD-Core Version:    0.6.2
 */